import * as XLSX from "xlsx";
import FileSaver from "file-saver";
export function exData(dom, title) {
  let wb = XLSX.utils.table_to_book(dom, { raw: true });
  let wbout = XLSX.write(wb, { bookType: "xlsx", bookSST: true, type: "array" });
  try {
    FileSaver.saveAs(new Blob([wbout], { type: "application/octet-stream" }), title + `.xlsx`);
  } catch (e) {
    if (typeof console !== "undefined") {
      console.log(e, wbout);
    }
  }
  return wbout;
}
